<!DOCTYPE html>
<html>
	<meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" type="text/css" href="css/style.css">
	<head>
		<title>An African Language Short Story Competition</title>
	</head>
<?php include 'submitdatabaseinfo.php';?>
<?php include 'submitsetup.php';?>
<?php include 'getlanguage.php';?>

	<body>
	    <ul>
                        <li><a id="home" href="index.php">Home</a></li>
                        <li><a id="original" class="active" href="#">Original Story Submission</a></li>
                        <li><a id="translation" href="submittranslation.php">Translated Story Submission</a></li>
			<li><a id="stories" href="displaystories.php">Submitted Stories</a></li>
                        <li><a id="statistics" href="submissionstatistics.php">Submissions per Language</a></li>
<!--                        <li><a id="coordinate" href="coordinator.php">Coordinator Application</a></li>
    -->                    <li><a id="contact" href="contact.php">Contact</a></li>
                        <li><a id="resources" href="resources.php">Resources</a></li>
                        <li><a id="flyers" href="flyers.php">Flyers</a></li>
                        <li><a id="faq" href="faq.php">Frequently Asked Questions</a></li>
                        <li><a id="privacy" href="privacy.php">Privacy</a></li>
	    </ul>
	    <header>
			<h1>Tuvute Pamoja
			<a href="https://deeplearningindaba.com">
                         <img src="images/deeplearningindaba.svg" alt="Deeplearning Indaba" style="height:60px">
			</a></h1>
<!--			<img style="float:right" alt="Translate this page" src="images/icon20x24px-exported-transparent.png" > 
			<select  id="translatesubmissionpage" name="Submitpagelanguage" style="float:right"
				onchange="translatewrap()">
				<option language="" value=""></option>
				<option language="English" value="eng">English</option>
				<option language="Kiswahili" value="swa">Kiswahili</option>
            </select>
-->
	</header>
		<h1 id="title">An African Language Short Story Competition</h1>
		<section>
			<div>
			<h3 id="descriptiontitle">General Description</h3>
			<p id="descriptiontext1">Thank you for making a submission. Your story should be suitable for people between the ages of 5 and 12 years old.  Your story should also draw some inspiration from the traditions and cultures of the group that uses that language.  Your story should be between 800 and 1200 words. Prizes will be available for each language, or language group for closely related languages. There will also be prizes available for translated stories. Stories will be judged by those who have submitted a story in a language or language group. Stories with the highest scores will win prizes. A prize of $20 will be given to the author of the best original short story in each language. A prize of $20 will be given to the translator of the best translated short story in each language.  A prize of $20 will be given to the author of the best translated short story in each language.  Stories will be evaluated on a 5 point scale on:</p>
			<ol>
			<li id="descriptiontext2">Grammar and spelling</li><br>
			<li id="descriptiontext3">Theme and plot</li><br>
			<li id="descriptiontext4">Style</li><br>
			<li id="descriptiontext5">Cultural relevance</li><br>
			<li id="descriptiontext6">Overall impression</li><br>
			</ol>
			<p id="descriptiontext7">The average score will be used to rank stories, in case of a tie, the organizing committee will randomly choose one story to receive a prize.</p>
			</div>
		</section>
		<section>
			<div>
			<h3 id="furtherules">Further Rules</h3>
			<ol>
			<li id="furtherrulestext1">Entries will be evaluated anonymously, authors may advertise the competition, and their entry in it, but should not advertise their authorship of an article until winners are announced.</li><br>
			<li id="furtherrulestext2">All entries will be released under a creative commons attribution license that allows others to distribute, remix, adapt and build upon your work, even commercially, as long as they credit you for the original creation. For more on this license see:</li><br><a href="https://creativecommons.org/licenses/by/4.0/">https://creativecommons.org/licenses/by/4.0/</a><br>
			<li id="furtherrulestext3">As your writing style may be used to identify you, for example through Stylometric analysis, you may choose to use a pseudonym.</li><br>
			<li id="furtherrulestext4">Should you win a prize and not wish to be identified, you may choose to have your earnings given to a charitable organization of your choice.</li><br>
			</ol>
			</div>
		</section>
		<section>
		<div>
			<br><br><br><br>
			<h2 id="storysubmission" >Story Submission</h2>
			<form method="post" action="">
			<p> 
			<label id="namelabel" for="name">What is your name/pseudonym?</label>
			<span class="error">*</span><br>
			<span class="error"><?php echo $nameErr;?></span><br>
			<input id="name" type="text" name="name" style="width:375px" maxlength="100"><br>
			</p>
			<p>
			<label id="legalpermissionlabel" for="legalpermission">Are you an adult in the region you live in, if not do you have permission from a parent or legal guardian to participate in this competition?</label>
			<span class="error">*</span><br>
			<span class="error"><?php echo $legalpermissionErr;?> </span><br>
			<select id="legalpermission" name="legalpermission">
			  <option id="legalpermissionno" value="no">no</option>
			  <option id="legalpermissionyes" value="yes">yes</option>
	    </select>
            </p>
            <p>
            <label id="emaillabel" for="email">What is your e-mail address?</label>
            <span class="error">*</span><br>
            <span class="error"><?php echo $emailErr;?></span><br>
            <input type="email" id="email" name="email" style="width:375px"><br>
            </p>
            <?php include 'gettelephone.php';?>
	<p>
	<label id="languagelabel" for="language">What language is your story in?</label><span class="error">*</span><br>
        <span class="error"><?php echo $languageErr;?></span><br>
	<select class="language" id="language" name="language">
	<option data-language="" value="<?php echo $language;?>"><?php echo $language;?></option>
        <?php include 'languagelist.php';?>
	</select>
	</p>
	<p>
        <label id="titlelabel" for="title">What is the title of your story</label>
        <span class="error">*</span><br>
        <span class="error"><?php echo $titleErr;?></span><br>
        <textarea id="title" type="text" name="title" maxlength="100" style="width:750px" rows="1"></textarea><br>
        </p>
<p>
                        <label id="authorshiplabel" for="authorship">Are you the author of this original submitted work, if you are not the author do you have permission from the author to submit the work on their behalf?</label>
                        <span class="error">*</span><br>
                        <span class="error"><?php echo $authorshipErr;?></span><br>
                        <select id="authorship" name="authorship">
                          <option id="authorshipno" value="no">no</option>
                          <option id="authorshipyes" value="yes">yes</option>
                        </select>
</p>
<p>
        <label id="storylabel" for="story">Please enter the text for your story here</label>
        <span class="error">*</span><br>
        <span class="error"><?php echo $storyErr;?></span><br>
        <textarea id="story" type="text" dir="ltr" name="story" cols="70" size="30000" maxlength="30000" rows="25" style="width:750px"></textarea><br>
    </p>
      <p>
      <button id="submit" type="submit" name="submit" value="submit">Submit</button>
    </p>
    </form>
  <p>
      <button id="wordcountbutton" onclick="wordcountinfo()">Update word count</button>  
     <!-- <button id="previewformatting" onclick="previewformatting()">Preview text formatting</button>-->
    </p>
    <h4 id="wordsentered">Words Entered:</h4>
    <h4 id="wordscounted">0</h4>
    <p id="previewtext"></p>
	</div>
	</section>
	<section>
			<div>
                        <div id="keyboarddiv">
                        <?php include "softkeyboard.php" ;?>
                        </div>
			</div>
		</section>
<section>
<p id="translator"></p>
</section>
<?php include 'submitsave.php';?>
</body>
<?php include 'footer.php';?>
<script type="text/javascript" src="js/englishsubmit.js"></script>
<script type="text/javascript" src="js/kiswahilisubmit.js"></script>
<script>
  if (sessionStorage.tplang==="eng") {
     englishsubmittranslation();
  } else if (sessionStorage.tplang==="swa") {
     kiswahilisubmittranslation();
  }
</script>
<script>
    function translatewrap()
    {
      var lang = document.getElementById("translatesubmissionpage").value;
      if (lang==="eng") {
		englishsubmittranslation();
                sessionStorage.tplang="eng";
      }else if (lang==="swa") {
	        kiswahilisubmittranslation();
	        sessionStorage.tplang="swa";
      }
    }
    function addcharacter(id)
	{
	  var charin = document.getElementById(id).value;
	  //var id = event.srcElement.id;
	  console.log(id);
	  console.log(charin);
	  var text = document.getElementById("story").value;
	  var input = document.getElementById("story");
	  var cursorpos = input.selectionStart;
      // A slow but reliable entry method
	  var start = text.substring(0,cursorpos);
	  var end = text.substring(cursorpos,text.length);
	  if (charin==="")
	  {
	      var character="";
	  }else if (id==="Backspace") {
	      var character="";
	      var start = start.substring(0,start.length-1);
	  }else if ((id==="Enter")||(id==="Tab")){
	      var character = charin;
	  }else{
	      var character = String.fromCharCode(charin);
	  }
	  console.log(character);
	  document.getElementById("story").value = start + character + end;
	}
    function shiftwrap()
    {
      var value = document.getElementById("keyboardtype").value;
      shift(value);
    }
	function changecasewrap()
	{
      var value = document.getElementById("keyboardtype").value;
      changecase(value);
	}
	function altgrwrap()
	{
      var value = document.getElementById("keyboardtype").value;
      altgr(value);
	}
	function keyboardwrap()
    {
      var value = document.getElementById("keyboardtype").value;
	  keyboard(value);
	  if(value==="ara") {
		document.getElementById("story").dir="rtl";
      }else{
		document.getElementById("story").dir="ltr";
      }
    }
</script>
<script type="text/javascript" src="js/afrikaanskeys.js"></script>
<script type="text/javascript" src="js/akankeys.js"></script>
<script type="text/javascript" src="js/amharickeys.js"></script>
<script type="text/javascript" src="js/arabickeys.js"></script>
<script type="text/javascript" src="js/atesokeys.js"></script>
<script type="text/javascript" src="js/bembakeys.js"></script>
<script type="text/javascript" src="js/camerooniankeys.js"></script>
<script type="text/javascript" src="js/dagbanikeys.js"></script>
<script type="text/javascript" src="js/englishkeys.js"></script>
<script type="text/javascript" src="js/ewekeys.js"></script>
<script type="text/javascript" src="js/gakeys.js"></script>
<script type="text/javascript" src="js/hausakeys.js"></script>
<script type="text/javascript" src="js/igbokeys.js"></script>
<script type="text/javascript" src="js/kikuyukeys.js"></script>
<script type="text/javascript" src="js/lingalakeys.js"></script>
<script type="text/javascript" src="js/lugandakeys.js"></script>
<script type="text/javascript" src="js/malikeys.js"></script>
<script type="text/javascript" src="js/sesothokeys.js"></script>
<script type="text/javascript" src="js/togokeys.js"></script>
<script type="text/javascript" src="js/wolofkeys.js"></script>
<script type="text/javascript" src="js/yorubakeys.js"></script>
<script type="text/javascript" src="js/keyboard.js"></script>
<script type="text/javascript" src="js/wordcount.js"></script>
</html>

